.PHONY:all
all:publish_client consume_client

CC = g++
CFLAGS = -std=c++20 -g
LDFLAGS = -lmuduo_net -lmuduo_base -lgtest -lprotobuf -lsqlite3 -lpthread -lz
PUBLISH_SRC  = publish_client.cc ../mqcomm/proto/mq_msg.pb.cc ../mqcomm/proto/mq_protocol.pb.cc ../mqthird/include/muduo/proto/codec.cc
CONSUME_SRC = consume_client.cc ../mqcomm/proto/mq_msg.pb.cc ../mqcomm/proto/mq_protocol.pb.cc ../mqthird/include/muduo/proto/codec.cc
INC = -I../mqthird/include
LIB = -L../mqthird/lib

publish_client:$(PUBLISH_SRC)
	$(CC) -o $@ $(PUBLISH_SRC) $(CFLAGS) $(INC) $(LIB) $(LDFLAGS)
consume_client:$(CONSUME_SRC)
	$(CC) -o $@ $(CONSUME_SRC) $(CFLAGS) $(INC) $(LIB) $(LDFLAGS)
.PHONY:clean
clean:
	rm -f publish_client consume_client